文字列からインデックス(と範囲)を指定して抽出
Top > Ruby [2.2.2] > []
p "acha"[1] # "c" p "porute"[6] # nil p "piipo"[3,4] # "po" p "achaporutepiipo"[16,1] # nil p "acha_porute_piipo"[0..-1] # "acha_porute_piipo" p "acha-porute-piipo"[/-(.{5})/] # "-porut" p "abcdefghijklmn"[/.{2}(.{4})/,1] # "cdef"